package com.zhangbo.service.imp;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.zhangbo.dao.ArticleMapper;
import com.zhangbo.entity.Article;
import com.zhangbo.service.ArticleService;
import com.zhangbo.utils.CmsContant;

@Service
public class ArticleServiceImp implements ArticleService {

	@Autowired
	ArticleMapper amap;
	
	@Override
	public PageInfo list(int page) {
		// TODO Auto-generated method stub
		PageHelper.startPage(page, CmsContant.PAGE_SIZE);
		return new PageInfo<Article>(amap.list());
	}

	@Override
	public Article getById(int id) {
		// TODO Auto-generated method stub
		return amap.getById(id);
	}

}
